package org.kepler.chat.api.infra;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author liuke
 * @date 2018/6/30 10:58
 */
@Component(value = "appConfig")
public class AppConfig {

    private static String website_title;

    private static String redis_keyPrefix;
    private static String file_repository_path;
    private static String file_base_url;

    public static String appId = "";//百度AI开放平台应用ID
    public static String apiKey = "";//百度AI开放平台应用Key
    public static String secretKey = "";//百度AI开放平台应用秘钥

    public static String matedata_app_secretKey = "";//元数据API密钥

    public static String fonts_repository_path = "";//字体存储路径

    public static String server_port = "";//服务端口号

    public static int login_remain_days;//距离机构截止日期的天数
    public static int login_macCount;//mac地址统计
    public static int login_ipCount;//连续异地登录次数

    public static String getAppId() {
        return appId;
    }

    @Value("${baidu.app.appId:}")
    public void setAppId(String appId) {
        AppConfig.appId = appId;
    }

    public static String getApiKey() {
        return apiKey;
    }

    @Value("${baidu.app.apiKey:}")
    public void setApiKey(String apiKey) {
        AppConfig.apiKey = apiKey;
    }

    public static String getSecretKey() {
        return secretKey;
    }

    @Value("${baidu.app.secretKey:}")
    public void setSecretKey(String secretKey) {
        AppConfig.secretKey = secretKey;
    }

    public static String getMatedata_app_secretKey() {
        return matedata_app_secretKey;
    }

    @Value("${matedata.app.secretKey:}")
    public void setMatedata_app_secretKey(String matedata_app_secretKey) {
        AppConfig.matedata_app_secretKey = matedata_app_secretKey;
    }

    public static String getWebsite_title() {
        return website_title;
    }

    @Value("${website.title:}")
    public void setWebsite_title(String website_title) {
        AppConfig.website_title = website_title;
    }

    public static String getRedis_keyPrefix() {
        return redis_keyPrefix;
    }

    @Value("${redis.keyPrefix:}")
    public void setRedis_keyPrefix(String redis_keyPrefix) {
        AppConfig.redis_keyPrefix = redis_keyPrefix;
    }

    public static String getFile_repository_path() {
        return file_repository_path;
    }

    @Value("${file.repository.path:}")
    public void setFile_repository_path(String file_repository_path) {
        AppConfig.file_repository_path = file_repository_path;
    }

    public static String getFile_base_url() {
        return file_base_url;
    }

    @Value("${file.base.url:}")
    public void setFile_base_url(String file_base_url) {
        AppConfig.file_base_url = file_base_url;
    }

    public static String getFonts_repository_path() {
        return fonts_repository_path;
    }

    @Value("${file.repository.path:}")
    public void setFonts_repository_path(String fonts_repository_path) {
        AppConfig.fonts_repository_path = fonts_repository_path;
    }

    public static String getServer_port() {
        return server_port;
    }

    @Value("${server.port:}")
    public void setServer_port(String server_port) {
        AppConfig.server_port = server_port;
    }

    public static int getLogin_remain_days() {
        return login_remain_days;
    }

    @Value("${login.remainDays:31}")
    public void setLogin_remain_days(int login_remain_days) {
        AppConfig.login_remain_days = login_remain_days;
    }

    public static int getLogin_macCount() {
        return login_macCount;
    }

    @Value("${login.macCount:5}")
    public void setLogin_macCount(int login_macCount) {
        AppConfig.login_macCount = login_macCount;
    }

    public static int getLogin_ipCount() {
        return login_ipCount;
    }

    @Value("${login.ipCount:5}")
    public void setLogin_ipCount(int login_ipCount) {
        AppConfig.login_ipCount = login_ipCount;
    }
}
